package com.itqf.hsh.controller;

import com.fasterxml.jackson.core.JsonProcessingException;
import com.itqf.hsh.dto.CommonDto;
import com.itqf.hsh.pojo.User;
import com.itqf.hsh.service.UserService;
import com.itqf.hsh.vo.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * projectName: qk_javaproject
 *
 * @author: 肖成扬
 * time: 2021/9/8 14:52
 * description:
 */
@RestController
@CrossOrigin("*")
@RequestMapping("/user")
public class userController {
    @Autowired
    private UserService userService;
    @PostMapping("login")
    public Object login(@RequestBody User user){
        R r=userService.login(user);
        return r;
    }
    @PostMapping("change")
    public Object change(@RequestBody CommonDto commonDto) throws JsonProcessingException {
        R r=userService.changeUser(commonDto);
        return r;
    }
}
